1. The Field of the Invention
The field of the present invention is computer software driver development. The present invention relates to tools, software frameworks, conventions, etc. to simplify code generation of drivers and provide standardized access points. More specifically, the present invention is directed to methods and computer program products for managing buffers used by multiple entities, such as interconnected software drivers, so that a minimum amount of inter-buffer data transfer occurs between entities during processing by software drivers running in a relatively unprotected operating system mode.
2. Present State of the Art
When multiple components process a stream or amount of data, they will typically place a quantity of data, such as a frame, into a buffer, process the data, and copy the manipulated data into another buffer corresponding to another processing component. If there are multiple independent processing components, the sheer volume of data transfers between buffers can impact processor performance to the degree that it may inhibit the actual processing of the data itself in a timely fashion.
While this problem may occur with any type of data processing between different components, it is particularly acute with the media data found in multimedia applications. This is due, in part, to the large quantities information generated that is in many instances tied to a time frame to effectively produce a veritable "stream" of continuous data for processing. Such media information may come from a live feed over a network, phone line, digitizing hardware, etc. or some other source such as a file and usually must be processed in "real time" so as to be coherent to a viewer or listener.
In a multimedia environment, when processing a stream of media data, the processor performance impact due to data transfers between different buffers creates a latency problem that reduces overall media processing and rendering performance of a hardware/software system. A latency problem may be so bad as to limit what a particular system may handle in terms of multimedia capabilities. The situation becomes exacerbated on general purpose computer systems such as a processor running Windows NT.TM. by Microsoft.RTM. because of the already existing demands on the processor. Reducing latency problems opens many opportunities to provide low-cost multimedia applications that would otherwise be unavailable. If latency is sufficiently reduced by increased system processing efficiency and other means, a general purpose computer system will be able to run multimedia applications that were previously not possible.
Another problem associated with multiple buffers corresponding to multiple processing components is the amount of system resources that may be used and therefore unavailable to other applications. In other words, if each processing component has its own buffer taken from system resources such as system memory, system resources become more scarce thereby causing inefficiencies that may result in degraded system performance.
Shared memory between processes and components attempts to address the resource allocation problem and allow shared buffers. A shared memory facility normally occurs at an operating system "user mode" that has significant safety overhead to assure only authorized applications used designated address spaces in system memory and where user written applications are run. The safety mechanisms are for assuring that one application or process will not impact another application.
In a multimedia environment, it is advantageous to interconnect software drivers to that processing may occur in software drivers that run in a operating system mode with a much higher run priority and little security protection to allow access to actual hardware that the drivers, in many instances, directly manipulate. Many applications are benefited by running in this looser and more performance-oriented mode, generally referred throughout, in Windows NT terminology, as "kernel mode." Other robust operating systems will have a functionally equivalent mode.
One prime example of a program currently incapable of easily using kernel mode drivers, used throughout this application, comprises graph building functionality that allows a user to select and connect together different processing blocks, called filters, to successively manipulate a stream of multimedia data. The data typically is a series of samples representing sound or video and the processing blocks may include decompression processing for compressed data, special effects processing, CODEC functionality, rendering the data into analog signals, etc.
Such filters typically are located in user mode so that the graph builder portion of the program may interconnect and control their operation and be responsive to user input and rearrangement of processing blocks. Because of the consistent stream nature of multimedia data and the generation of large quantities of data, performance is a critical issue. In a general purpose operating system, system performance caused by repeatedly passing/switching back and forth between user mode and kernel mode can be so degraded as to prohibit certain multimedia applications as mentioned previously.
Furthermore, the processing blocks will many times have hardware associated therewith requiring multiple transitions between user mode and kernel mode components. Such transitions comprise another form of overhead that takes away from the overall multimedia processing system performance. When making transitions between user mode kernel mode, there may also be overhead associated with copying the data between different buffers that would be unnecessary if the processing remained in kernel mode.
What is needed is a mechanism for creating a shared buffer and communicating its existence between independent software drivers so that data may be processed in the same buffer by two or more components in an interconnected software driver environment. It would be advantageous for such a mechanism to also communicate buffer requirements of a software driver to allow a third party agent such as a graph builder dynamically interconnect different software drivers to accomplish a certain media stream processing sequence.